package com.mes.service.tdd;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mes.dao.tdd.ProcurementRukuMaterielMapper;
import com.mes.entity.tdd.ProcurementRukuMateriel;
import com.mes.entity.tdd.ProcurementRukuMaterielExample;
import com.mes.entity.tdd.ProcurementRukuMaterielExample.Criteria;
import com.mes.entity.tdd.tj.Tpage;
/**
 * 
 *@ClassName: ProcurementRukuMaterielServiceImpl 
 *@Description: 到货单详情
 *@Author tdd
 *@Date 2018-6-6 上午10:03:54 
 *@version 1.0
 */
@Service
@Transactional
public class ProcurementRukuMaterielServiceImpl implements ProcurementRukuMaterielService{
	//注入到货单详情Mapp
	@Resource ProcurementRukuMaterielMapper rukuMaterielMapper;
	/**
	 * 到货单详情分页
	 */
	@Override
	public List<ProcurementRukuMateriel> list(Tpage pageBean) {
		return rukuMaterielMapper.list(pageBean);
	}
	/**
	 * 到货单详情查询
	 */
	@Override
	public List<ProcurementRukuMateriel> allList(Tpage pageBean) {
		return rukuMaterielMapper.allList(pageBean);
	}
	/**
	 * 到货单详情条数
	 */
	@Override
	public int total(Tpage pageBean) {
		return rukuMaterielMapper.total(pageBean);
	}
	/**
	 * 到货单详情添加
	 */
	@Override
	public Long add(ProcurementRukuMateriel rukuMateriel) {
		Long add = rukuMaterielMapper.add(rukuMateriel);
		return add;
	}
	/**
	 * 到货单详情修改
	 * @param procurementRukuMateriel 到货单详情
	 * @return 影响行数
	 */
	@Override
	public int updata(ProcurementRukuMateriel rukuMateriel) {
		return rukuMaterielMapper.edit(rukuMateriel);
	}
	/**
	 * 到货单详情删除
	 */
	@Override
	public int updatadelete(ProcurementRukuMateriel rukuMateriel) {
		return rukuMaterielMapper.delete(rukuMateriel);
	}
	/**
	 * 根据到货单id查询
	 */
	@Override
	public List<ProcurementRukuMateriel> find(ProcurementRukuMateriel rukuMateriel) {
		ProcurementRukuMaterielExample example = new ProcurementRukuMaterielExample();
		Criteria createCriteria = example.createCriteria();
		if (rukuMateriel.getPrid() != null) {
			createCriteria.andPridEqualTo(rukuMateriel.getPrid());
		}
		return rukuMaterielMapper.selectByExample(example );
	}

}
